import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
testCase = "DBshop015_添加侧边设置"

# 调用函数 实例化浏览器对象 打开指定网址
driver = openBrowser(urlAdmin)
# 调用函数登录后台
DBshopLoginAdmin(driver)
# 处理三级菜单
DBshopEnterMenu3(driver,'商品管理','管理分类','前台侧边设置')
# 点击添加
driver.find_element_by_partial_link_text("添加侧边显示").click()
# 输入内容
driver.find_element_by_id("frontside_name").send_keys(mingcheng)
# 清空输入框里的内容并重新输入
driver.find_element_by_id("frontside_sort").clear()
driver.find_element_by_id("frontside_sort").send_keys("255")
# 点击保存
driver.find_element_by_xpath("//button").click()

# 取出页面上的值
actual = driver.find_element_by_xpath("//tr[1]/td[2]/input").get_property("value")
yuqizhi = "255"
# 断言
if actual == yuqizhi:
    writeLog("%s 测试通过" % (testCase))
else:
    writeLog("%s 测试失败" % (testCase))
    getPhoto(driver)
driver.quit()